<!DOCTYPE html>



  


<html class="theme-next mist use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.2" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="shiro," />





  <link rel="alternate" href="/atom.xml" title="Hfbin Blog" type="application/atom+xml" />




  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.2" />






<meta name="description" content="最新资讯近日，在微软亚洲研究院与哈工大共同举办的第十九届“二十一世纪的计算”国际学术研讨会上， Peter Lee 博士作为微软全球资深副总裁， 也来到了现场。AI科技大本营非常有幸采访到这位微软研究院的核心领导之一。对话中，Peter Lee透露了很多信息。谈到微软在 AI 研究和 AI 产业化方面布局这个问题时，他表示微软对新技术、新机会非常重视，投入得非常多，微软现在领先 20 年。 简介1">
<meta name="keywords" content="shiro">
<meta property="og:type" content="article">
<meta property="og:title" content="shiro 简介">
<meta property="og:url" content="http://yoursite.com/2017/11/02/shiro 简介/index.html">
<meta property="og:site_name" content="Hfbin Blog">
<meta property="og:description" content="最新资讯近日，在微软亚洲研究院与哈工大共同举办的第十九届“二十一世纪的计算”国际学术研讨会上， Peter Lee 博士作为微软全球资深副总裁， 也来到了现场。AI科技大本营非常有幸采访到这位微软研究院的核心领导之一。对话中，Peter Lee透露了很多信息。谈到微软在 AI 研究和 AI 产业化方面布局这个问题时，他表示微软对新技术、新机会非常重视，投入得非常多，微软现在领先 20 年。 简介1">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://img.blog.csdn.net/20171102010351553?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcXFfMzM1MjQxNTg=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171102011002654?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcXFfMzM1MjQxNTg=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171102011453690?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcXFfMzM1MjQxNTg=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171102013026626?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcXFfMzM1MjQxNTg=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171102013735205?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcXFfMzM1MjQxNTg=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:updated_time" content="2018-01-06T06:10:58.360Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="shiro 简介">
<meta name="twitter:description" content="最新资讯近日，在微软亚洲研究院与哈工大共同举办的第十九届“二十一世纪的计算”国际学术研讨会上， Peter Lee 博士作为微软全球资深副总裁， 也来到了现场。AI科技大本营非常有幸采访到这位微软研究院的核心领导之一。对话中，Peter Lee透露了很多信息。谈到微软在 AI 研究和 AI 产业化方面布局这个问题时，他表示微软对新技术、新机会非常重视，投入得非常多，微软现在领先 20 年。 简介1">
<meta name="twitter:image" content="http://img.blog.csdn.net/20171102010351553?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcXFfMzM1MjQxNTg=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    sidebar: {"position":"left","display":"post","offset":12,"offset_float":12,"b2t":false,"scrollpercent":true,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: 'FQWD7RL0XS',
      apiKey: 'ad0b6762f0b7721176ce7c215ba85c58',
      indexName: 'hfbin',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>

<script>
    (function(){
        if(''){
            if (prompt('该文章博主已加密') !== ''){
                alert('密码错误！');
                history.back();
            }
        }
    })();
</script>


  <link rel="canonical" href="http://yoursite.com/2017/11/02/shiro 简介/"/>

    <script src="//cdn.bootcss.com/pace/1.0.2/pace.min.js"></script>
	<link href="//cdn.bootcss.com/pace/1.0.2/themes/pink/pace-theme-flash.css" rel="stylesheet">
<style>
    .pace .pace-progress {
        background: #1E92FB; /*进度条颜色*/
        height: 3px;
    }
    .pace .pace-progress-inner {
         box-shadow: 0 0 10px #1E92FB, 0 0 5px     #1E92FB; /*阴影颜色*/
    }
    .pace .pace-activity {
        border-top-color: #1E92FB;    /*上边框颜色*/
        border-left-color: #1E92FB;    /*左边框颜色*/
    }
</style>

	


  <title>shiro 简介 | Hfbin Blog</title>
  












  <div style="display: none;">
    <script src="//s95.cnzz.com/z_stat.php?id=1266987503&web_id=1266987503" language="JavaScript"></script>
  </div>





</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

 
    

  
  
  
  <link rel="stylesheet" href="/lib/algolia-instant-search/instantsearch.min.css">

  
  
  <script src="/lib/algolia-instant-search/instantsearch.min.js"></script>
  

  <script type="text/javascript" src="/js/src/algolia.js?v=5.1.2"></script>

  
  
  
    
  

  <div class="container sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"></span>
        <span class="site-title">Hfbin Blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">My friend promised me to go if I had the road</p>
      
  </div>

  <div class="site-nav-toggle" style="position: absolute; float: left; ">
    <button>
      <span class="btn-bar" style="background: #fff;"></span>
      <span class="btn-bar" style="background: #fff;"></span>
      <span class="btn-bar" style="background: #fff;"></span>
    </button>
  </div>
</div>

<nav class="site-nav" >
  <!-- set hasSearch = theme.swiftype_key || theme.algolia_search.enable || theme.tinysou_Key || theme.local_search.enable % -->
  	


  
    <ul id="menu" class="menu" >
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
			 <!-- 增加下面语句 -->
		  
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  
  <div class="algolia-popup popup search-popup">
    <div class="algolia-search">
      <div class="algolia-search-input-icon">
        <i class="fa fa-search"></i>
      </div>
      <div class="algolia-search-input" id="algolia-search-input"></div>
    </div>

    <div class="algolia-results">
      <div id="algolia-stats"></div>
      <div id="algolia-hits"></div>
      <div id="algolia-pagination" class="algolia-pagination"></div>
    </div>

    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
  </div>




    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2017/11/02/shiro 简介/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="HuangFuBin">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="https://avatars3.githubusercontent.com/u/26451830?s=400&u=fac2b4c7903b3ad1210b530e2d18e42fcb410b0a&v=4">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Hfbin Blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">shiro 简介</h1>
        

        <div class="post-meta">
			 
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-11-02T17:22:01+08:00">
                2017-11-02
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/shiro/" itemprop="url" rel="index">
                    <span itemprop="name">shiro</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
              <span class="post-meta-divider">|</span>
              <span class="post-meta-item-icon">
                <i class="fa fa-comment-o"></i>
              </span>
              
                <a href="/2017/11/02/shiro 简介/#SOHUCS" itemprop="discussionUrl">
                  <span id="changyan_count_unit" class="post-comments-count hc-comment-count" data-xid="2017/11/02/shiro 简介/" itemprop="commentsCount"></span>
                </a>
              
            
          

          
          

          
            <span class="post-meta-divider">|</span>
            <span class="page-pv"><i class="fa fa-file-o"></i>
            <span class="busuanzi-value" id="busuanzi_value_page_pv" ></span>
            </span>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h4 id="最新资讯"><a href="#最新资讯" class="headerlink" title="最新资讯"></a><strong>最新资讯</strong></h4><p>近日，在微软亚洲研究院与哈工大共同举办的第十九届“二十一世纪的计算”国际学术研讨会上， Peter Lee 博士作为微软全球资深副总裁， 也来到了现场。AI科技大本营非常有幸采访到这位微软研究院的核心领导之一。对话中，Peter Lee透露了很多信息。谈到微软在 AI 研究和 AI 产业化方面布局这个问题时，他表示微软对新技术、新机会非常重视，投入得非常多，微软现在领先 20 年。</p>
<h4 id="简介"><a href="#简介" class="headerlink" title="简介"></a><strong>简介</strong></h4><p>1、Apache Shiro 是Java  的一个安全（权限）框架<br>2、Shiro 可以非常容易的开发出足够好的应用，其不仅可以用在JavaSE环境，也可以用JavaEE环境。<br>3、Shiro可以完成：认证、授权、加密、会话管理、与Web 集成、缓存等。<br>4、下载：<a href="http://shiro.apache.org/" target="_blank" rel="external">http://shiro.apache.org/</a></p>
<h4 id="功能介绍"><a href="#功能介绍" class="headerlink" title="功能介绍"></a><strong>功能介绍</strong></h4><p>基本功能点如下图所示：<br><img src="http://img.blog.csdn.net/20171102010351553?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcXFfMzM1MjQxNTg=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"><br>•    <em>Authentication</em>：身份认证/登录，验证用户是不是拥有相应的身份；</p>
<p>•    <em>Authorization</em>：授权，即权限验证，验证某个已认证的用户是否拥有某个权限；即判断用户是否能进行什么操作，如：验证某个用户是否拥有某个角色。或者细粒度的验证某个用户对某个资源是否具有某个权限；</p>
<p>•    <em>Session Manager</em>：会话管理，即用户登录后就是一次会话，在没有退出之前，它的所有信息都在会话中；会话可以是普通 JavaSE 环境，也可以是 Web 环境的；</p>
<p>•    <em>Cryptography</em>：加密，保护数据的安全性，如密码加密存储到数据库，而不是明文存储；</p>
<p>•    <em>Web Support</em>：Web 支持，可以非常容易的集成到Web 环境；</p>
<p>•    <em>Caching</em>：缓存，比如用户登录后，其用户信息、拥有的角色/权限不必每次去查，这样可以提高效率；</p>
<p>•    <em>Concurrency</em>：Shiro 支持多线程应用的并发验证，即如在一个线程中开启另一个线程，能把权限自动传播过去；</p>
<p>•    <em>Testing</em>：提供测试支持；</p>
<p>•    <em>Run As</em>：允许一个用户假装为另一个用户（如果他们允许）的身份进行访问；</p>
<p>•    <em>Remember Me</em>：记住我，这个是非常常见的功能，即一次登录后，下次再来的话不用登录了</p>
<h4 id="Shrio架构（shiro外部来看）"><a href="#Shrio架构（shiro外部来看）" class="headerlink" title="Shrio架构（shiro外部来看）"></a><strong>Shrio架构（shiro外部来看）</strong></h4><p>从外部来看Shiro，即从应用程序角度的来观察如何使Shiro完成工作：<br><img src="http://img.blog.csdn.net/20171102011002654?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcXFfMzM1MjQxNTg=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<p>•    Subject：应用代码直接交互的对象是 Subject，也就是说 Shiro 的对外API 核心就是 Subject。Subject 代表了当前“用户”， 这个用户不一定是一个具体的人，与当前应用交互的任何东西都是 Subject，如网络爬虫，机器人等；与 Subject  的所有交互都会委托给 SecurityManager；Subject 其实是一个门面，SecurityManager 才是实际的执行者；</p>
<p>•    SecurityManager：安全管理器；即所有与安全有关的操作都会与SecurityManager 交互；且其管理着所有 Subject；可以看出它是 Shiro 的核心，它负责与 Shiro 的其他组件进行交互，它相当于 SpringMVC 中DispatcherServlet 的角色</p>
<p>•    Realm：Shiro 从 Realm 获取安全数据（如用户、角色、权限），就是说SecurityManager 要验证用户身份，那么它需要从 Realm 获取相应的用户进行比较以确定用户身份是否合法；也需要从 Realm 得到用户相应的角色/ 权限进行验证用户是否能进行操作；可以把 Realm 看成 DataSource</p>
<h4 id="Shrio架构（shiro内部来看）"><a href="#Shrio架构（shiro内部来看）" class="headerlink" title="Shrio架构（shiro内部来看）"></a><strong>Shrio架构（shiro内部来看）</strong></h4><p><img src="http://img.blog.csdn.net/20171102011453690?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcXFfMzM1MjQxNTg=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"><br>•    Subject：任何可以与应用交互的“用户”；</p>
<p>•    SecurityManager ：相当于SpringMVC 中的 DispatcherServlet；是 Shiro 的心脏；所有具体的交互都通过 SecurityManager 进行控制；它管理着所有 Subject、且负责进行认证、授权、会话及缓存的管理。</p>
<p>•    Authenticator：负责 Subject 认证，是一个扩展点，可以自定义实现；可以使用认证策略（Authentication Strategy），即什么情况下算用户认证通过了；</p>
<p>•    Authorizer：授权器、即访问控制器，用来决定主体是否有权限进行相应的操作；即控制着用户能访问应用中的哪些功能；</p>
<p>•    Realm：可以有 1 个或多个 Realm，可以认为是安全实体数据源，即用于获取安全实体的；可以是JDBC 实现，也可以是内存实现等等；由用户提供；所以一般在应用中都需要实现自己的 Realm；</p>
<p>•    SessionManager：管理 Session 生命周期的组件；而 Shiro 并不仅仅可以用在 Web 环境，也可以用在如普通的 JavaSE 环境</p>
<p>•    CacheManager：缓存控制器，来管理如用户、角色、权限等的缓存的；因为这些数据基本上很少改变，放到缓存中后可以提高访问的性能</p>
<p>•    Cryptography：密码模块，Shiro 提高了一些常见的加密组件用于如密码加密/解密。</p>
<h4 id="Shiro—HelloWorld"><a href="#Shiro—HelloWorld" class="headerlink" title="Shiro—HelloWorld"></a><strong>Shiro—HelloWorld</strong></h4><p>这个 HelloWorld 是在shiro官方参考文档拿出来的</p>
<p><img src="http://img.blog.csdn.net/20171102013026626?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcXFfMzM1MjQxNTg=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<p>log4j.properties<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div></pre></td><td class="code"><pre><div class="line">log4j.rootLogger=INFO, stdout</div><div class="line"></div><div class="line">log4j.appender.stdout=org.apache.log4j.ConsoleAppender</div><div class="line">log4j.appender.stdout.layout=org.apache.log4j.PatternLayout</div><div class="line">log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m %n</div><div class="line"></div><div class="line"># General Apache libraries</div><div class="line">log4j.logger.org.apache=WARN</div><div class="line"></div><div class="line"># Spring</div><div class="line">log4j.logger.org.springframework=WARN</div><div class="line"></div><div class="line"># Default Shiro logging</div><div class="line">log4j.logger.org.apache.shiro=TRACE</div><div class="line"></div><div class="line"># Disable verbose logging</div><div class="line">log4j.logger.org.apache.shiro.util.ThreadContext=WARN</div><div class="line">log4j.logger.org.apache.shiro.cache.ehcache.EhCache=WARN</div></pre></td></tr></table></figure></p>
<p>shiro.imi<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div><div class="line">42</div><div class="line">43</div><div class="line">44</div><div class="line">45</div><div class="line">46</div><div class="line">47</div><div class="line">48</div><div class="line">49</div><div class="line">50</div><div class="line">51</div><div class="line">52</div><div class="line">53</div><div class="line">54</div><div class="line">55</div><div class="line">56</div><div class="line">57</div><div class="line">58</div></pre></td><td class="code"><pre><div class="line">#</div><div class="line"># Licensed to the Apache Software Foundation (ASF) under one</div><div class="line"># or more contributor license agreements.  See the NOTICE file</div><div class="line"># distributed with this work for additional information</div><div class="line"># regarding copyright ownership.  The ASF licenses this file</div><div class="line"># to you under the Apache License, Version 2.0 (the</div><div class="line"># &quot;License&quot;); you may not use this file except in compliance</div><div class="line"># with the License.  You may obtain a copy of the License at</div><div class="line">#</div><div class="line">#     http://www.apache.org/licenses/LICENSE-2.0</div><div class="line">#</div><div class="line"># Unless required by applicable law or agreed to in writing,</div><div class="line"># software distributed under the License is distributed on an</div><div class="line"># &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY</div><div class="line"># KIND, either express or implied.  See the License for the</div><div class="line"># specific language governing permissions and limitations</div><div class="line"># under the License.</div><div class="line">#</div><div class="line"># =============================================================================</div><div class="line"># Quickstart INI Realm configuration</div><div class="line">#</div><div class="line"># For those that might not understand the references in this file, the</div><div class="line"># definitions are all based on the classic Mel Brooks&apos; film &quot;Spaceballs&quot;. ;)</div><div class="line"># =============================================================================</div><div class="line"></div><div class="line"># -----------------------------------------------------------------------------</div><div class="line"># Users and their assigned roles</div><div class="line">#</div><div class="line"># Each line conforms to the format defined in the</div><div class="line"># org.apache.shiro.realm.text.TextConfigurationRealm#setUserDefinitions JavaDoc</div><div class="line"># -----------------------------------------------------------------------------</div><div class="line">[users]</div><div class="line"># user &apos;root&apos; with password &apos;secret&apos; and the &apos;admin&apos; role</div><div class="line">root = secret, admin</div><div class="line"># user &apos;guest&apos; with the password &apos;guest&apos; and the &apos;guest&apos; role</div><div class="line">guest = guest, guest</div><div class="line"># user &apos;presidentskroob&apos; with password &apos;12345&apos; (&quot;That&apos;s the same combination on</div><div class="line"># my luggage!!!&quot; ;)), and role &apos;president&apos;</div><div class="line">presidentskroob = 12345, president</div><div class="line"># user &apos;darkhelmet&apos; with password &apos;ludicrousspeed&apos; and roles &apos;darklord&apos; and &apos;schwartz&apos;</div><div class="line">darkhelmet = ludicrousspeed, darklord, schwartz</div><div class="line"># user &apos;lonestarr&apos; with password &apos;vespa&apos; and roles &apos;goodguy&apos; and &apos;schwartz&apos;</div><div class="line">lonestarr = vespa, goodguy, schwartz</div><div class="line"></div><div class="line"># -----------------------------------------------------------------------------</div><div class="line"># Roles with assigned permissions</div><div class="line"># </div><div class="line"># Each line conforms to the format defined in the</div><div class="line"># org.apache.shiro.realm.text.TextConfigurationRealm#setRoleDefinitions JavaDoc</div><div class="line"># -----------------------------------------------------------------------------</div><div class="line">[roles]</div><div class="line"># &apos;admin&apos; role has all permissions, indicated by the wildcard &apos;*&apos;</div><div class="line">admin = *</div><div class="line"># The &apos;schwartz&apos; role can do anything (*) with any lightsaber:</div><div class="line">schwartz = lightsaber:*</div><div class="line"># The &apos;goodguy&apos; role is allowed to &apos;delete&apos; (action) the user (type) with</div><div class="line"># license plate &apos;zhangsan&apos; (instance specific id)</div><div class="line">goodguy = user:delete:zhangsan</div></pre></td></tr></table></figure></p>
<p>Quickstart.java<br><figure class="highlight java"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div><div class="line">42</div><div class="line">43</div><div class="line">44</div><div class="line">45</div><div class="line">46</div><div class="line">47</div><div class="line">48</div><div class="line">49</div><div class="line">50</div><div class="line">51</div><div class="line">52</div><div class="line">53</div><div class="line">54</div><div class="line">55</div><div class="line">56</div><div class="line">57</div><div class="line">58</div><div class="line">59</div><div class="line">60</div><div class="line">61</div><div class="line">62</div><div class="line">63</div><div class="line">64</div><div class="line">65</div><div class="line">66</div><div class="line">67</div><div class="line">68</div><div class="line">69</div><div class="line">70</div><div class="line">71</div><div class="line">72</div><div class="line">73</div><div class="line">74</div><div class="line">75</div><div class="line">76</div><div class="line">77</div><div class="line">78</div><div class="line">79</div><div class="line">80</div><div class="line">81</div><div class="line">82</div><div class="line">83</div><div class="line">84</div><div class="line">85</div><div class="line">86</div><div class="line">87</div><div class="line">88</div><div class="line">89</div><div class="line">90</div><div class="line">91</div><div class="line">92</div><div class="line">93</div><div class="line">94</div><div class="line">95</div><div class="line">96</div><div class="line">97</div><div class="line">98</div><div class="line">99</div><div class="line">100</div><div class="line">101</div><div class="line">102</div><div class="line">103</div><div class="line">104</div><div class="line">105</div><div class="line">106</div><div class="line">107</div><div class="line">108</div><div class="line">109</div><div class="line">110</div><div class="line">111</div><div class="line">112</div><div class="line">113</div><div class="line">114</div><div class="line">115</div><div class="line">116</div><div class="line">117</div><div class="line">118</div><div class="line">119</div><div class="line">120</div><div class="line">121</div><div class="line">122</div><div class="line">123</div><div class="line">124</div><div class="line">125</div><div class="line">126</div><div class="line">127</div><div class="line">128</div><div class="line">129</div><div class="line">130</div><div class="line">131</div><div class="line">132</div><div class="line">133</div><div class="line">134</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">package</span> com.atguigu.shiro.helloworld;</div><div class="line"></div><div class="line"><span class="keyword">import</span> org.apache.shiro.SecurityUtils;</div><div class="line"><span class="keyword">import</span> org.apache.shiro.authc.*;</div><div class="line"><span class="keyword">import</span> org.apache.shiro.config.IniSecurityManagerFactory;</div><div class="line"><span class="keyword">import</span> org.apache.shiro.mgt.SecurityManager;</div><div class="line"><span class="keyword">import</span> org.apache.shiro.session.Session;</div><div class="line"><span class="keyword">import</span> org.apache.shiro.subject.Subject;</div><div class="line"><span class="keyword">import</span> org.apache.shiro.util.Factory;</div><div class="line"><span class="keyword">import</span> org.slf4j.Logger;</div><div class="line"><span class="keyword">import</span> org.slf4j.LoggerFactory;</div><div class="line"></div><div class="line"></div><div class="line"><span class="comment">/**</span></div><div class="line"><span class="comment"> * Simple Quickstart application showing how to use Shiro's API.</span></div><div class="line"><span class="comment"> *</span></div><div class="line"><span class="comment"> * <span class="doctag">@since</span> 0.9 RC2</span></div><div class="line"><span class="comment"> */</span></div><div class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">Quickstart</span> </span>&#123;</div><div class="line"></div><div class="line">    <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> <span class="keyword">transient</span> Logger log = LoggerFactory.getLogger(Quickstart.class);</div><div class="line"></div><div class="line"></div><div class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">main</span><span class="params">(String[] args)</span> </span>&#123;</div><div class="line"></div><div class="line">        <span class="comment">// The easiest way to create a Shiro SecurityManager with configured</span></div><div class="line">        <span class="comment">// realms, users, roles and permissions is to use the simple INI config.</span></div><div class="line">        <span class="comment">// We'll do that by using a factory that can ingest a .ini file and</span></div><div class="line">        <span class="comment">// return a SecurityManager instance:</span></div><div class="line"></div><div class="line">        <span class="comment">// Use the shiro.ini file at the root of the classpath</span></div><div class="line">        <span class="comment">// (file: and url: prefixes load from files and urls respectively):</span></div><div class="line">        Factory&lt;SecurityManager&gt; factory = <span class="keyword">new</span> IniSecurityManagerFactory(<span class="string">"classpath:shiro.ini"</span>);</div><div class="line">        SecurityManager securityManager = factory.getInstance();</div><div class="line"></div><div class="line">        <span class="comment">// for this simple example quickstart, make the SecurityManager</span></div><div class="line">        <span class="comment">// accessible as a JVM singleton.  Most applications wouldn't do this</span></div><div class="line">        <span class="comment">// and instead rely on their container configuration or web.xml for</span></div><div class="line">        <span class="comment">// webapps.  That is outside the scope of this simple quickstart, so</span></div><div class="line">        <span class="comment">// we'll just do the bare minimum so you can continue to get a feel</span></div><div class="line">        <span class="comment">// for things.</span></div><div class="line">        SecurityUtils.setSecurityManager(securityManager);</div><div class="line"></div><div class="line">        <span class="comment">// Now that a simple Shiro environment is set up, let's see what you can do:</span></div><div class="line"></div><div class="line">        <span class="comment">// get the currently executing user:</span></div><div class="line">        <span class="comment">// 获取当前的 Subject. 调用 SecurityUtils.getSubject();</span></div><div class="line">        Subject currentUser = SecurityUtils.getSubject();</div><div class="line"></div><div class="line">        <span class="comment">// Do some stuff with a Session (no need for a web or EJB container!!!)</span></div><div class="line">        <span class="comment">// 测试使用 Session </span></div><div class="line">        <span class="comment">// 获取 Session: Subject#getSession()</span></div><div class="line">        Session session = currentUser.getSession();</div><div class="line">        session.setAttribute(<span class="string">"someKey"</span>, <span class="string">"aValue"</span>);</div><div class="line">        String value = (String) session.getAttribute(<span class="string">"someKey"</span>);</div><div class="line">        <span class="keyword">if</span> (value.equals(<span class="string">"aValue"</span>)) &#123;</div><div class="line">            log.info(<span class="string">"---&gt; Retrieved the correct value! ["</span> + value + <span class="string">"]"</span>);</div><div class="line">        &#125;</div><div class="line"></div><div class="line">        <span class="comment">// let's login the current user so we can check against roles and permissions:</span></div><div class="line">        <span class="comment">// 测试当前的用户是否已经被认证. 即是否已经登录. </span></div><div class="line">        <span class="comment">// 调动 Subject 的 isAuthenticated() </span></div><div class="line">        <span class="keyword">if</span> (!currentUser.isAuthenticated()) &#123;</div><div class="line">        	<span class="comment">// 把用户名和密码封装为 UsernamePasswordToken 对象</span></div><div class="line">            UsernamePasswordToken token = <span class="keyword">new</span> UsernamePasswordToken(<span class="string">"lonestarr"</span>, <span class="string">"vespa"</span>);</div><div class="line">            <span class="comment">// rememberme</span></div><div class="line">            token.setRememberMe(<span class="keyword">true</span>);</div><div class="line">            <span class="keyword">try</span> &#123;</div><div class="line">            	<span class="comment">// 执行登录. </span></div><div class="line">                currentUser.login(token);</div><div class="line">            &#125; </div><div class="line">            <span class="comment">// 若没有指定的账户, 则 shiro 将会抛出 UnknownAccountException 异常. </span></div><div class="line">            <span class="keyword">catch</span> (UnknownAccountException uae) &#123;</div><div class="line">                log.info(<span class="string">"----&gt; There is no user with username of "</span> + token.getPrincipal());</div><div class="line">                <span class="keyword">return</span>; </div><div class="line">            &#125; </div><div class="line">            <span class="comment">// 若账户存在, 但密码不匹配, 则 shiro 会抛出 IncorrectCredentialsException 异常。 </span></div><div class="line">            <span class="keyword">catch</span> (IncorrectCredentialsException ice) &#123;</div><div class="line">                log.info(<span class="string">"----&gt; Password for account "</span> + token.getPrincipal() + <span class="string">" was incorrect!"</span>);</div><div class="line">                <span class="keyword">return</span>; </div><div class="line">            &#125; </div><div class="line">            <span class="comment">// 用户被锁定的异常 LockedAccountException</span></div><div class="line">            <span class="keyword">catch</span> (LockedAccountException lae) &#123;</div><div class="line">                log.info(<span class="string">"The account for username "</span> + token.getPrincipal() + <span class="string">" is locked.  "</span> +</div><div class="line">                        <span class="string">"Please contact your administrator to unlock it."</span>);</div><div class="line">            &#125;</div><div class="line">            <span class="comment">// ... catch more exceptions here (maybe custom ones specific to your application?</span></div><div class="line">            <span class="comment">// 所有认证时异常的父类. </span></div><div class="line">            <span class="keyword">catch</span> (AuthenticationException ae) &#123;</div><div class="line">                <span class="comment">//unexpected condition?  error?</span></div><div class="line">            &#125;</div><div class="line">        &#125;</div><div class="line"></div><div class="line">        <span class="comment">//say who they are:</span></div><div class="line">        <span class="comment">//print their identifying principal (in this case, a username):</span></div><div class="line">        log.info(<span class="string">"----&gt; User ["</span> + currentUser.getPrincipal() + <span class="string">"] logged in successfully."</span>);</div><div class="line"></div><div class="line">        <span class="comment">//test a role:</span></div><div class="line">        <span class="comment">// 测试是否有某一个角色. 调用 Subject 的 hasRole 方法. </span></div><div class="line">        <span class="keyword">if</span> (currentUser.hasRole(<span class="string">"schwartz"</span>)) &#123;</div><div class="line">            log.info(<span class="string">"----&gt; May the Schwartz be with you!"</span>);</div><div class="line">        &#125; <span class="keyword">else</span> &#123;</div><div class="line">            log.info(<span class="string">"----&gt; Hello, mere mortal."</span>);</div><div class="line">            <span class="keyword">return</span>; </div><div class="line">        &#125;</div><div class="line"></div><div class="line">        <span class="comment">//test a typed permission (not instance-level)</span></div><div class="line">        <span class="comment">// 测试用户是否具备某一个行为. 调用 Subject 的 isPermitted() 方法。 </span></div><div class="line">        <span class="keyword">if</span> (currentUser.isPermitted(<span class="string">"lightsaber:weild"</span>)) &#123;</div><div class="line">            log.info(<span class="string">"----&gt; You may use a lightsaber ring.  Use it wisely."</span>);</div><div class="line">        &#125; <span class="keyword">else</span> &#123;</div><div class="line">            log.info(<span class="string">"Sorry, lightsaber rings are for schwartz masters only."</span>);</div><div class="line">        &#125;</div><div class="line"></div><div class="line">        <span class="comment">//a (very powerful) Instance Level permission:</span></div><div class="line">        <span class="comment">// 测试用户是否具备某一个行为. </span></div><div class="line">        <span class="keyword">if</span> (currentUser.isPermitted(<span class="string">"user:delete:zhangsan"</span>)) &#123;</div><div class="line">            log.info(<span class="string">"----&gt; You are permitted to 'drive' the winnebago with license plate (id) 'eagle5'.  "</span> +</div><div class="line">                    <span class="string">"Here are the keys - have fun!"</span>);</div><div class="line">        &#125; <span class="keyword">else</span> &#123;</div><div class="line">            log.info(<span class="string">"Sorry, you aren't allowed to drive the 'eagle5' winnebago!"</span>);</div><div class="line">        &#125;</div><div class="line"></div><div class="line">        <span class="comment">//all done - log out!</span></div><div class="line">        <span class="comment">// 执行登出. 调用 Subject 的 Logout() 方法. </span></div><div class="line">        System.out.println(<span class="string">"----&gt;"</span> + currentUser.isAuthenticated());</div><div class="line">        </div><div class="line">        currentUser.logout();</div><div class="line">        </div><div class="line">        System.out.println(<span class="string">"----&gt;"</span> + currentUser.isAuthenticated());</div><div class="line"></div><div class="line">        System.exit(<span class="number">0</span>);</div><div class="line">    &#125;</div><div class="line">&#125;</div></pre></td></tr></table></figure></p>
<p>在这就截图运行后面打印的两个结果 , 中间的打印信息可以自己去尝试，每一个方法都有说明。</p>
<p><img src="http://img.blog.csdn.net/20171102013735205?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcXFfMzM1MjQxNTg=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<h3 id="介绍完毕-各位大佬-喜欢可以赞一下或关注一下哦"><a href="#介绍完毕-各位大佬-喜欢可以赞一下或关注一下哦" class="headerlink" title="介绍完毕  各位大佬  喜欢可以赞一下或关注一下哦"></a>介绍完毕  各位大佬  喜欢可以赞一下或关注一下哦</h3>
      
    </div>
    
    
    

    

    
      <div>
        <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
  <div>坚持原创技术分享，您的支持将鼓励我继续创作！</div>
  <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
    <span>Donate</span>
  </button>
  <div id="QR" style="display: none;">

    
      <div id="wechat" style="display: inline-block">
        <img id="wechat_qr" src="/images/weixinpay.png" alt="HuangFuBin WeChat Pay"/>
        <p>WeChat Pay</p>
      </div>
    

    
      <div id="alipay" style="display: inline-block">
        <img id="alipay_qr" src="/images/alipay.png" alt="HuangFuBin Alipay"/>
        <p>Alipay</p>
      </div>
    

    

  </div>
</div>

      </div>
    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/shiro/" <i class="fa fa-tag"></i> shiro</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/11/01/常见配置redis.conf介绍 /" rel="next" title="常见配置redis.conf介绍">
                <i class="fa fa-chevron-left"></i> 常见配置redis.conf介绍
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/11/03/Maven+SSM（SpringMVC+Spring+Mybatis） 框架整合/" rel="prev" title="Maven+SSM（SpringMVC+Spring+Mybatis） 框架整合">
                Maven+SSM（SpringMVC+Spring+Mybatis） 框架整合 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
        <!-- JiaThis Button BEGIN -->
<div class="jiathis_style">
  <a class="jiathis_button_weixin"></a>
  <a class="jiathis_button_cqq"></a>
  <a class="jiathis_button_tsina"></a>
  <!--<a class="jiathis_button_tqq"></a>-->
  
  <!--<a class="jiathis_button_douban"></a>-->
  <!--<a class="jiathis_button_renren"></a>-->
  <a class="jiathis_button_qzone"></a>
  <!--<a class="jiathis_button_kaixin001"></a>-->
  <a class="jiathis_button_copy"></a>
  <a href="http://www.jiathis.com/share" class="jiathis jiathis_txt jiathis_separator jtico jtico_jiathis" target="_blank"></a>
  <a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" >
  var jiathis_config={
    hideMore:false
  }
</script>
<script type="text/javascript" src="http://v3.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END -->

      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div id="SOHUCS"></div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="https://avatars3.githubusercontent.com/u/26451830?s=400&u=fac2b4c7903b3ad1210b530e2d18e42fcb410b0a&v=4"
               alt="HuangFuBin" />
          <p class="site-author-name" itemprop="name">HuangFuBin</p>
           
              <p class="site-description motion-element" itemprop="description">My friend promised me to go if I had the road</p>
          
        </div>
        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
              <a href="/archives/">
                <span class="site-state-item-count">107</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-categories">
              <a href="/categories/index.html">
                <span class="site-state-item-count">28</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">37</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        
          <div class="feed-link motion-element">
            <a href="/atom.xml" rel="alternate">
              <i class="fa fa-rss"></i>
              RSS
            </a>
          </div>
        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/hfbin" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                    
                      GitHub
                    
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&email=DmZ7b2BpaHtsZ2AgbGF9fU5oYXZjb2diIG1hYw" target="_blank" title="E-Mail">
                  
                    <i class="fa fa-fw fa-envelope"></i>
                  
                    
                      E-Mail
                    
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://weibo.com/3904243687/profile?rightmod=1&wvr=6&mod=personinfo&is_all=1" target="_blank" title="Weibo">
                  
                    <i class="fa fa-fw fa-weibo"></i>
                  
                    
                      Weibo
                    
                </a>
              </span>
            
          
        </div>

        
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.hfbin.cn/" title="Title" target="_blank">Title</a>
                </li>
              
            </ul>
          </div>
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-4"><a class="nav-link" href="#最新资讯"><span class="nav-number">1.</span> <span class="nav-text">最新资讯</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#简介"><span class="nav-number">2.</span> <span class="nav-text">简介</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#功能介绍"><span class="nav-number">3.</span> <span class="nav-text">功能介绍</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Shrio架构（shiro外部来看）"><span class="nav-number">4.</span> <span class="nav-text">Shrio架构（shiro外部来看）</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Shrio架构（shiro内部来看）"><span class="nav-number">5.</span> <span class="nav-text">Shrio架构（shiro内部来看）</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Shiro—HelloWorld"><span class="nav-number">6.</span> <span class="nav-text">Shiro—HelloWorld</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#介绍完毕-各位大佬-喜欢可以赞一下或关注一下哦"><span class="nav-number"></span> <span class="nav-text">介绍完毕  各位大佬  喜欢可以赞一下或关注一下哦</span></a></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <!--
<div class="copyright display_zhanzhang" style="text-align: center !important;">
  <span class="author" itemprop="copyrightHolder">桂ICP备16010161号</span>
</div>
-->
<div class="copyright" style="text-align: center !important;">
  
  &copy;  2017 - 
  <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">HuangFuBin</span>
</div>
<div class="copyright" style="text-align: center !important;">
	
	<div class="powered-by" style="text-align: center !important;">
	  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
	</div>

	<div class="theme-info" style="text-align: center !important;">
	  主题 -
	  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
		NexT.Mist
	  </a>
	</div>
	
</div>
<div class="copyright display_zhanzhang"  style="text-align: center !important;">
<script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_1266987503'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s19.cnzz.com/z_stat.php%3Fid%3D1266987503%26online%3D1%26show%3Dline' type='text/javascript'%3E%3C/script%3E"));</script>
</div>
        

<div class="busuanzi-count">
  

  
    <span class="site-uv">
      <i class="fa fa-user"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_uv"></span>
      
    </span>
  

  
    <span class="site-pv">
      <i class="fa fa-eye"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_pv"></span>
      
    </span>
  
</div>
<script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>


        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
          <span id="scrollpercent"><span>0</span>%</span>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.2"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.2"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.2"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.2"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.2"></script>



  


  




	





  





  




  
    <script type="text/javascript">
    (function(){
      var appid = 'cysX5MNF0';
      var conf = '504c8a8b8a5aff5f06dd805c527bbf0f';
      var width = window.innerWidth || document.documentElement.clientWidth;
      if (width < 960) {
      window.document.write('<script id="changyan_mobile_js" charset="utf-8" type="text/javascript" src="https://changyan.sohu.com/upload/mobile/wap-js/changyan_mobile.js?client_id=' + appid + '&conf=' + conf + '"><\/script>'); } else { var loadJs=function(d,a){var c=document.getElementsByTagName("head")[0]||document.head||document.documentElement;var b=document.createElement("script");b.setAttribute("type","text/javascript");b.setAttribute("charset","UTF-8");b.setAttribute("src",d);if(typeof a==="function"){if(window.attachEvent){b.onreadystatechange=function(){var e=b.readyState;if(e==="loaded"||e==="complete"){b.onreadystatechange=null;a()}}}else{b.onload=a}}c.appendChild(b)};loadJs("https://changyan.sohu.com/upload/changyan.js",function(){
        window.changyan.api.config({appid:appid,conf:conf})});
      }
    })();
    </script>
    <script type="text/javascript" src="https://assets.changyan.sohu.com/upload/plugins/plugins.count.js"></script>
  



  




  
  
  
  <link rel="stylesheet" href="/lib/algolia-instant-search/instantsearch.min.css">

  
  
  <script src="/lib/algolia-instant-search/instantsearch.min.js"></script>
  

  <script src="/js/src/algolia-search.js?v=5.1.2"></script>



  

  

  

  

  
  <script type="text/javascript" src="/js/src/js.cookie.js?v=5.1.2"></script>
  <script type="text/javascript" src="/js/src/scroll-cookie.js?v=5.1.2"></script>


  

  <!-- 页面点击小红心 -->
<script type="text/javascript" src="/js/src/love.js"></script>
</body>

</html>
